﻿using System;

using SBPweb.Forge.Contracts.Events;

using SBPweb.PROvibe.Business.Shared.Contracts.Content;

namespace SBPweb.PROvibe.Business.Client.Library.Modularity
{

    internal class ObjectLoadDescriptor<TType>
    {

        internal ObjectLoadDescriptor(TypeDescriptor typeDescriptor, EventHandler<ModuleLoaderObjectCreatedEventArgs<TType>> loadedHandler, object userState, params object[] constructorParams)
            : this(typeDescriptor.XapPath, typeDescriptor.AssemblyPath, typeDescriptor.FullyQualifiedTypeName, loadedHandler, userState, constructorParams)
        {
        }

        internal ObjectLoadDescriptor(string xapPath, string asmPath, string typeName, EventHandler<ModuleLoaderObjectCreatedEventArgs<TType>> loadedHandler, object userState, params object[] constructorParams)
        {
            XapPath = xapPath;
            AssemblyPath = asmPath;
            FullyQualifiedTypeName = typeName;
            LoadedHandler = loadedHandler;
            UserState = userState;
            ConstructorParameters = constructorParams;
        }

        internal string XapPath;

        internal string AssemblyPath;

        internal string FullyQualifiedTypeName;

        internal EventHandler<ModuleLoaderObjectCreatedEventArgs<TType>> LoadedHandler;

        internal object UserState;

        internal object[] ConstructorParameters;

    }

}